import random

setGlobalDuration(10)

def printTime():
    if ti1.getBeat() == 1 and (ti1.getBar() % 4) == 0:
        ti1.changeTime(random.randint(100,200) * 0.001)
    print ti1.getTime()

ti1 = pattern(0.125, printTime, [1,1,1,1])
ti1.start()
ti1.play()

startCsound()

